		var redirect_uri = "";	//"<s:property value="loginUrl"/>";
		var gotoUrl = "";		//"<s:property value="gotoUrl"/>";
		var appId = "";			// <s:property value="appId"/>;
		var loginUrl = ""; 		// <s:property value="loginUrl"/>;
	//	<script src="https://g.alicdn.com/dingding/dinglogin/0.0.2/ddLogin.js"></script>
		
		var hanndleMessage = function (event) {
			var loginTmpCode = event.data; //拿到loginTmpCode后就可以在这里构造跳转链接进行跳转了
			var origin = event.origin;
			$.ajax({
				url: "loginTmpCode.action",
				type: "POST",
				data: {loginTmpCode: loginTmpCode},
				dataType: "json",
				success: function(result){
					if (result.success){
						var baseUrl =  "https://oapi.dingtalk.com";
						var interfaceUrl = "/connect/oauth2/sns_authorize";
						var baseParams="?appid="+appId+"&response_type=code&scope=snsapi_login&state=STATE";
						var redirectUri = "&redirect_uri="+loginUrl+""+"%3DloginTmpCode%26"+loginTmpCode;
						window.location.href=baseUrl+interfaceUrl+baseParams+redirectUri+"&loginTmpCode="+loginTmpCode;
					}else{
						alert("调用失败："+result.errorMessage);
					}
				},
				error: function(){
					alert("调用错误！");
				}
			});
		};
		
		if (typeof window.addEventListener != 'undefined') {
		    window.addEventListener('message', hanndleMessage, false);
		} else if (typeof window.attachEvent != 'undefined') {
		    window.attachEvent('onmessage', hanndleMessage);
		}
		
		$(document).ready(function(){
			var old = "https://oapi.dingtalk.com/connect/qrconnect?appid="+appId+"&response_type=code&scope=snsapi_login&state=STATE&redirect_uri="+loginUrl+"";
		});

		function ddLogin(){
			var obj = DDLogin({
			     id:"dingTalkLogin",//这里需要你在自己的页面定义一个HTML标签并设置id，例如<div id="login_container"></div>或<span id="login_container"></span>
			     goto: gotoUrl,
			     style: "",
			     href: "",
			     width : "300px",
			     height: "300px"
			 });
		}
		